package com.dht.xiao.jianye.bean;

import com.dht.xiao.jianye.R;

import java.io.Serializable;

public class DropBean implements Serializable{
    private Integer[] Images = { R.drawable.com_home_ic_plastic,R.drawable.home_ic_clothes, R.drawable.com_home_ic_paper, R.drawable.com_home_ic_metal,
            R.drawable.com_home_ic_plastic};
    private Integer[] images_open = {R.mipmap.bg_tips_plastic, R.mipmap.bg_tips_clothes, R.mipmap.bg_tips_paper, R.mipmap.bg_tips_metal,R.mipmap.bg_tips_plastic};
    private Integer[] images_mini = {R.mipmap.result_ic_plastic, R.mipmap.result_ic_clothes,R.mipmap.result_ic_paper, R.mipmap.result_ic_metal ,R.mipmap.result_ic_plastic};

    public int image,image_Open,image_mini;
    public String name,price_full;
    public double price;
    public Boolean trouble;//是否故障
    /**
     * 这个箱子对应类型，跟硬件对应,就是代表目前的，
     0:主箱
     1:塑料                        
     2:纺织
     3:金属                        
     4:纸类
     * */
    public int box;

    public String[] boxState;
    public String isOpen,isCount;

    public DropBean(String name, double price,int box,String[] boxState,Boolean trouble,String isOpen, String isCount) {
//        this.image = image;
//        this.image_Open = image_Open;
//        this.image_mini = image_mini;
        this.isOpen = isOpen;
        this.isCount = isCount;
        getimage(box);
        this.name = name;
        this.price = price;
        if (price == 0){
            price_full = "公益回收";
        }else {
            price_full = price+"元/公斤";
        }

        this.box = box;
        this.boxState = boxState;
        this.trouble = trouble;
    }

    private void  getimage(int box){
        if (box >= Images.length) {
            image = Images[0];
            image_Open = images_open[0];
            image_mini = images_mini[0];

        }else {
            image = Images[box];
            image_Open = images_open[box];
            image_mini = images_mini[box];
        }
    }
    public String[] getBoxState() {
        return boxState;
    }

    public void setBoxState(String[] boxState) {
        this.boxState = boxState;
    }

    public Boolean getTrouble() {
        return trouble;
    }

    public void setTrouble(Boolean trouble) {
        this.trouble = trouble;
    }
}
